//////////////////////////////////////////////////////////////////////
//  Jack McCaffery
//  11-10-2014
//////////////////////////////////////////////////////////////////////

#pragma once

#include "topicModel/fixedParameters.H"
#include "topicModel/parameterGroup.H"


/// \brief Model parametrs constrained by upper and lower bounds
///	   SC is the scalar type of the parameters
template <class SC>
class BoundedParameters : public ParameterGroup<SC>
{
public:
	~BoundedParameters ();
	BoundedParameters ();

	/// \brief Apply a gradient with a rate parameter
	/// \param gradient_ The gradient to apply. Dimensions must
	///	   match the dimensions of data
	/// \param rate_ A rate that controls the magnitude of the gradient
	void applyGradient (FixedParameters<SC> const &gradient_, double rate_);

	/// \brief Set the lower bound value
	/// \param lb_ New lower bound value
	void setLowerBound (SC lb_)
	{ lowerBound = lb_; }

	/// \brief Set the upper bound value
	/// \param ub_ New upper bound value
	void setUpperBound (SC ub_)
	{ upperBound = ub_; }

private:
	/// \brief Minimum value after applying gradient
	SC lowerBound;

	/// \brief Maximum value after applying gradient
	SC upperBound;
};



